package com.yidu.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yidu.common.Tools;
import com.yidu.dao.ListenMusicalTypeMapper;
import com.yidu.domain.ListenMusicalType;
import com.yidu.service.ListenMusicalTypeService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiangyu
 * @since 2018-11-27
 */
@Service
public class ListenMusicalTypeServiceImpl  implements ListenMusicalTypeService {
	@Resource
	private ListenMusicalTypeMapper dao;
	/**
	 * 查询全部
	 */
	@Override
	public List<ListenMusicalType> selectAll(Map<String, Object> map) {
		List<ListenMusicalType> list =dao.selectAll(map);
		for (ListenMusicalType listenMusicalType : list) {
			String ti=Tools.getTimeStr(listenMusicalType.getOpenTime());
			listenMusicalType.setTime(ti);
		}
		
		return list;
	}
	/**
	 * 查询总行数
	 */
	@Override
	public int selectC(Map<String, Object> map) {
		return dao.selectC(map);
	}
	/**
	 * 显示类型
	 */
	@Override
	public List<ListenMusicalType> selectName(ListenMusicalType mt) {
		List<ListenMusicalType> list =dao.selectName(mt);
		return list;
	}
	/**
	 * 根据ID查询
	 */
	@Override
	public ListenMusicalType selectByPrimaryKey(String mtId) {
		return dao.selectByPrimaryKey(mtId);
	}
	/**
	 * 增加
	 */
	@Override
	public void insertSelective(ListenMusicalType mt) {
		mt.setMtId(Tools.getRandomString());
		 dao.insertSelective(mt);
	}
	/**
	 * 修改
	 */
	@Override
	public void updateByPrimaryKeySelective(ListenMusicalType mt) {
		dao.updateByPrimaryKeySelective(mt);
	}
	/**
	 * 修改isva
	 */
	@Override
	public int updatei(String id) {
		return dao.updatei(id);
	}
	
	
}
